home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload Trio 2
/
Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO
/
dir39
/
bootcpu2.zip
/
BOOTCPU.BAS
next >
Wrap
BASIC Source File
|
1994-07-05
|
2KB
|
108 lines
Rem * Bootcpu v2.0
Rem * New features:
Rem * Boot selectable warm, or cold.
Rem * Wait for number of seconds before boot.
Rem * Test for certain time to reboot.
Rem * Returns dos errorlevel.
DefInt A-Z
Boot.Type=0 ' 1=warm, 2=cold
Wait.Time!=0 ' seconds to wait
Start.Time!=0 ' time range begin
Stop.Time!=0 ' time range end
C$=Command$
If C$="" Then
Goto Command.Line
Endif
While Len(C$)
D=Instr(C$," ")
If D>0 Then
D$=Left$(C$,D-1)
C$=Mid$(C$,D+1)
Else
D$=C$
C$=""
Endif
If D$="W" Then
Boot.Type=1
Else
If D$="C" Then
Boot.Type=2
Else
If Left$(D$,1)="+" Then
Wait.Time!=Int(Val(Mid$(D$,2)))
Else
If Instr(D$,",") Then
Start.Time!=Int(Val(Left$(D$,Instr(D$,",")-1)))
Stop.Time!=Int(Val(Mid$(D$,Instr(D$,",")+1)))
Else
Goto Command.Line
Endif
Endif
Endif
Endif
Wend
If Boot.Type=0 Goto Command.Line
If Start.Time!>0 And Stop.Time!>0 Then
If Start.Time!>86400! Or Stop.Time!>86400! Then Goto Command.Line
If Start.Time!>Stop.Time! Goto Command.Line
Endif
Print "Bootcpu v2.0"
If Start.Time!>0 And Stop.Time!>0 Then
If Start.Time!<Timer And Stop.Time!>Timer Then
If Wait.Time!>0 Then
Goto Reboot.Wait
Else
Goto Reboot
Endif
Else
Print "Time not within range."
End 4
Endif
Endif
Reboot.Wait:
If Wait.Time!>0 Then
Print "Waiting for"+Str$(Wait.Time!)+" seconds."
Start.Time!=Timer
Var=0
While Var=0
Elapsed!=Timer-Start.Time!
If Elapsed!<0! Then
Elapsed!=Elapsed!+86400!
Endif
If Elapsed!>=Wait.Time! Then
Var=-1
Endif
Wend
Goto Reboot
Endif
Goto Reboot
End
Reboot:
If Boot.Type=1 Then Goto Warm.Boot
If Boot.Type=2 Then Goto Cold.Boot
End
Command.Line:
Print "Bootcpu v2.0 command line:"
Print " <wc> w=warm, c=cold"
Print " [+#] wait for # seconds"
Print " [t1,t2] range of time"
End 1
Warm.Boot:
Def Seg = 0
Poke &H473, &H12
Poke &H472, &H34
Def Seg = &HFFFF
Call Absolute(0)
Print "Warm boot failed!"
End 2
Cold.Boot:
Def Seg = &Hffff
Call Absolute(0)
Print "Cold boot failed!"
End 2